package com.wish.controller;


import com.github.pagehelper.PageInfo;
import com.wish.dto.TSfTerminationDto;
import com.wish.dto.TsfContractDto;
import com.wish.entity.TSfContract;
import com.wish.entity.TSfTermination;
import com.wish.service.ITSfTerminationService;
import com.wish.vo.ResultEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 五组
 * @since 2021-03-30
 */
@Slf4j
@RestController
@RequestMapping("/wish/t-sf-termination")
public class TSfTerminationController {

    @Autowired
    ITSfTerminationService itSfTerminationService;

    @RequestMapping("list")
    public ResultEntity list(TSfTerminationDto tSfTerminationDto){

        PageInfo<TSfTermination> list = itSfTerminationService.getlist(tSfTerminationDto);

        return ResultEntity.ok("200","成功",list);

    }
    @RequestMapping("savetermination")
    public ResultEntity savetermination(@RequestBody TSfTerminationDto sfTerminationDto){
        log.info("接参"+sfTerminationDto);
        itSfTerminationService.savetermination(sfTerminationDto);
        return ResultEntity.ok("解约协议录入成功");
    }

}
